import { EntitySchema } from '@mikro-orm/core';

export class LeTaskUser {
  id!: string;
  UID!: string;
  number?: string;
  total?: string;
  consume?: string;
  isDeleted?: number = 0;
  createdTime?: number = 0;
  updatedTime?: number = 0;
  deletedTime?: number = 0;
}

export const LeTaskUserSchema = new EntitySchema({
  class: LeTaskUser,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    UID: { type: 'string', fieldName: 'UID', columnType: 'bigint' },
    number: { type: 'string', columnType: 'bigint', nullable: true, defaultRaw: `0` },
    total: { type: 'string', columnType: 'bigint', nullable: true, defaultRaw: `0` },
    consume: { type: 'string', columnType: 'bigint', nullable: true, defaultRaw: `0` },
    isDeleted: { type: 'number', columnType: 'tinyint', nullable: true, default: 0 },
    createdTime: { type: 'number', nullable: true, default: 0 },
    updatedTime: { type: 'number', nullable: true, default: 0 },
    deletedTime: { type: 'number', nullable: true, default: 0 },
  },
});
